﻿using EasyToHelp.DBFactory;
using EasyToHelp.Entity;
using System;
using System.Collections.Generic;
using System.Text;

namespace EasyToHelp.Service
{
    public class UsersService: IUsersService
    {
        public Users GetUser(int Id)
        {
            using (var context = ContextHelper.Context(ContextHelper._connString))
            {
                return context.Query<Users>().Where(x => x.Id == Id).FirstOrDefault();
            }
        }

        public List<Users> GetUserList()
        {
            using (var context = ContextHelper.Context(ContextHelper._connString))
            {
                return context.Query<Users>().ToList();
            }
        }

     

      
    }
}
